<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>享送小哥</title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
</head>

<body class="bg-f">
    <div id="data-loading">
        <div class="loading1"><img src="../images/loading.gif"></div>
    </div>
    <div class="aui-content vue">
        <img src="../images/xx.png" class="stars-img">
        <ul class="stars-list">
            <li :class="{active:star>=1}" @click="setStar(1)"></li>
            <li :class="{active:star>=2}" @click="setStar(2)"></li>
            <li :class="{active:star>=3}" @click="setStar(3)"></li>
            <li :class="{active:star>=4}" @click="setStar(4)"></li>
            <li :class="{active:star>=5}" @click="setStar(5)"></li>
        </ul>
        <!-- <textarea class="eval-area" placeholder="请输入您的留言"></textarea> -->
        <input class="aui-btn aui-btn-info login-sub1 aui-margin-tb-30" value="提交" type="submit" @click="submit">
    </div>
    <script type="text/javascript" src="../script/api.js"></script>
    <script type="text/javascript" src="../script/vue.js"></script>
    <script type="text/javascript" src="../script/app.js"></script>
    <script type="text/javascript">
        apiready = function() {
            vObj = new Vue({
                el: ".vue",
                data: {
                    order_id: api.pageParam.order_id,
                    action: api.pageParam.action,
                    star: 0
                },
                methods: {
                    setStar: function(value) {
                        this.star = value;
                    },
                    submit: function() {
                        if (this.star < 1) {
                            app.error("请先评分后再提交！");
                            return;
                        }
                        api.showProgress({
                            title: '正在提交',
                            text: '请稍候...',
                            modal: false
                        });
                        app.request.post(this.action, {
                            order_id: this.order_id,
                            star: this.star
                        }, {}, function(res) {
                            if (res.code == 200) {
                                api.execScript({
                                    script: 'reloadGetOrder()'
                                });
                                api.closeFrame();
                            } else {
                                app.error(res.message);
                            }
                            api.hideProgress();
                        });
                    }
                }
            });
            app.request.finish(vObj);
        }
    </script>
</body>

</html>
